import request from '@/utils/request';
import {toParams} from '@/utils/utils';

export async function queryList(params) {
  return request(`/api/template/list?${toParams(params)}`);
}

export async function queryData(id) {
  return request(`/api/template/${id}`);
}


export async function addData(resData) {
  return request('/api/template', {
    method: 'POST',
    data:resData,
  });
}

export async function updateData(resData) {
  return request(`/api/template/${resData.productId}`, {
    method: 'PUT',
    data: resData,
  });
}

export async function deleteData(id) {
  return request(`/api/template/${id}`, {
    method: 'DELETE'
  });
}

export async function updateStatus(id,status){
  return request(`/api/template/${id}/status/${status}`, {
    method: 'PUT'
  });
}